#define DEBUG
#include <cstdio>
#include <cmath>

using namespace std;

const int maxn=100000;

void sieve(int n, int prime[]) {
  prime[0] = 0;
  static bool book[maxn+1]; 
  book[1] = true;
  for (int i=2; i<=n; i++) {
    if (!book[i]) {
      prime[++prime[0]] = i;
    }
    for (int j=1; j<=prime[0] && prime[j]*i<=n; j++) {
      book[prime[j]*i] = true;
      if (i%prime[j]==0) {
        break;
      }
    }
  }
}

int gcd(int a, int b) {
  for (int r=a%b; r; a=b, b=r, r=a%b);
  return b;
}

bool check(int n, int a[], int p) {
  if (a[0]%p!=0) {
    return false;
  }
  static int temp[maxn+1];
  for (int i=0; i<=n; i++) {
    temp[i] = (a[i]%p+p)%p;
  }

  for (int i=n; i-p+1>0; i--) {
    temp[i-p+1]=(temp[i-p+1]+temp[i])%p;
    temp[i] = 0;
    if (i-p+1<p && temp[i-p+1]) {
      return false;
    }
  }
  for (int i=0; i<=n; i++) {
    if (temp[i]) {
      return false;
    }
  }
  return true;
}

int main() {
  freopen("poly.in", "r", stdin);
  freopen("poly.out", "w", stdout);

  static int a[maxn+1];
  int n, t;
  scanf("%d", &n);
  for (int i=n; i>=0; i--) {
    scanf("%d", a+i);
  }
  t=abs(a[0]);
  for (int i=1; i<=n; i++) {
    if (a[i]) {
      t = gcd(t, abs(a[i]));
    }
  }

  static int p[maxn+1];
  sieve(n, p);
  for (int i=1; i<=p[0]; i++) {
    if (t%p[i]==0) {
      printf("%d\n", p[i]);
      for (; t%p[i]==0; t/=p[i]);
    } else if (check(n, a, p[i])) {
      printf("%d\n", p[i]);
    }
  }

  for (int i=2; i<=sqrt(t); i++) {
    if (t%i==0) {
      printf("%d\n", i);
    }
    for (; t%i==0; t/=i);
  }
  if (t>1) {
    printf("%d", t);
  }

  fclose(stdin);
  fclose(stdout);
  return 0;
}
